<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
     <!-- 定义子组件接收消息的变量和内容                  定义监听消息和处理方法 -->
    <SunComponent  :msg="content" @update:msg="handleUpdateMsg"/>
  </div>
</template>

<script>

import SunComponent from './components/SunComponent.vue'

export default {
  name: 'App',
  components: {
    SunComponent
  },
  data() {
    return {
      content: 'Welcome to Your Vue.js App' 
    }
  },
  methods: {
    handleUpdateMsg(newMsg) {
      this.content = newMsg
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
